package com.hsj.mq.rabbitmq.topic.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class RabbitConfigTopic {
    @Bean
    public Queue topicQueue(){
        return  new Queue("topic_queue",true,true,true);
    }

    @Bean
    public TopicExchange topicExchange(){
        return  new TopicExchange("topicExchange");
    }

    @Bean
    public Binding bindingtopic(){
        return BindingBuilder.bind(topicQueue()).to(topicExchange()).with("topic.order.id");
    }

}
